package model01;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class WriteIntegerToFile {
	public static void main(String[] args) {
		PrintWriter pw;
		File f;
		try {
			f = new File("integerfile.txt");
			pw = new PrintWriter(f);
			
			int[] a = new int[5];
			
			Scanner s = new Scanner(System.in);
			
			//nhap day so nguyen tu ban phim
			for(int i = 0; i < a.length; i++) {
				System.out.print("So thu " + (i + 1) + ": ");
				a[i] = s.nextInt();
			}
			
			//ghi day so nguyen ra file
			for(int i = 0; i < a.length; i++) {
				pw.println(a[i]);
			}
			
			pw.close();
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
